package com.lening.service;

import com.lening.entity.OrderBean;
import com.lening.entity.PowerBean;
import com.lening.entity.ProductBean;
import com.lening.entity.UserBean;
import com.lening.mapper.StuMapper;
import com.lening.utils.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 创作时间：2019/8/22 9:46
 * 作者：李增强
 */
@Service
public class StuService {
    @Resource
    StuMapper stuMapper;

    public List<PowerBean> getPowerList() {
        return stuMapper.getPowerList();
    }
    public int getUserCount() {
        return stuMapper.getUserCount();
    }
    public List<UserBean> getUserList(Page page) {
        return stuMapper.getUserList(page.getStartRecord(),page.getPageSize());
    }

    public List<OrderBean> getUserOrderList(UserBean rub) {
        if(rub!=null){
            return stuMapper.getUserOrderList(rub.getId());
        }
        return null;
    }

    public List<ProductBean> getProList() {
        return stuMapper.getProList();
    }

    public ProductBean getProById(ProductBean pb) {
        if(pb!=null){
            return stuMapper.getProById(pb.getPid());
        }
        return null;
    }

}
